home *** CD-ROM | disk | FTP | other *** search
/ La Traviata / La Traviata.iso / viewer / gif.arc / SCRSAVE.ASM < prev    next >
Assembly Source File  |  1988-02-07  |  2KB  |  75 lines

  1. ;**************************************************************************
  2. ;Written 1/30/88-2/3/88 by Jim Griebel.
  3. ;An SCR/SCP save routine written in assembly to avoid Turbo's pickiness
  4. ;about file sizes and definitions. The format of the files is simple
  5. ;enough: just a 16-bit palette, followed by 4 bitplanes which are either
  6. ;28,000 (for a 640x350 pic) or 38,400 (for a 640x480 byte pic) big. For
  7. ;some weird reason the bitplanes are written in 0, 2, 1, 3 order.
  8. ;As it turns out EGA Paint will not display .SCP files on a 640x350 EGA;
  9. ;so the global variable EGAHeight is set to 350 in the main program,
  10. ;forcing FSIZE to 28000.
  11. ;**************************************************************************
  12.  
  13.  
  14.  
  15. data       segment word public
  16.            assume ds:data
  17.  
  18. ;Turbo's file definition for this file; the first word of the definition
  19. ;is, fortunately, the file handle, so we can let Turbo open it
  20.  
  21.            extrn scrfile:word
  22.  
  23. ;The data that will be written to the file, as defined in Turbo
  24.  
  25.            extrn palette:word,plane0:dword,plane2:dword,plane1:dword
  26.            extrn plane3:dword
  27.  
  28. ;And the size value for writing out
  29.  
  30.            extrn fsize: word
  31.            data ends
  32.  
  33. code       segment word public
  34.            assume cs:code
  35.  
  36.            public scrsave
  37. scrsave    proc near
  38.            push ds
  39.            lea  dx,palette
  40.            mov  cx,16
  41.            mov  bx,scrfile
  42.            mov  ax,4000h
  43.            int  21h
  44.            mov  bx,scrfile
  45.            mov  cx,fsize
  46.            lds  dx,plane0
  47.            mov  ax,4000h
  48.            int  21h
  49.            pop  ds
  50.            push ds
  51.            mov  bx,scrfile
  52.            mov  cx,fsize
  53.            lds  dx,plane2
  54.            mov  ax,4000h
  55.            int  21h
  56.            pop  ds
  57.            push ds
  58.            mov  bx,scrfile
  59.            mov  cx,fsize
  60.            lds  dx,plane1
  61.            mov  ax,4000h
  62.            int  21h
  63.            pop  ds
  64.            push ds
  65.            mov  bx,scrfile
  66.            mov  cx,fsize
  67.            lds  dx,plane3
  68.            mov  ax,4000h
  69.            int  21h
  70.            pop  ds
  71.            ret
  72. scrsave    endp
  73.            code  ends
  74.            end   scrsave
  75.            end